<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html lang="zh-CN">
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Home</title>
<meta name="keywords" content="">
<meta name="description" content="">
<link rel="stylesheet" type="text/css" href="/Public/Home/css/bootstrap.min.css">
<link rel="stylesheet" type="text/css" href="/Public/Home/css/nprogress.css">
<link rel="stylesheet" type="text/css" href="/Public/Home/css/style.css">
<link rel="stylesheet" type="text/css" href="/Public/Home/css/font-awesome.min.css">
<link rel="apple-touch-icon-precomposed" href="/Public/Home/images/icon.png">
<link rel="shortcut icon" href="/Public/Home/images/favicon.ico">
<script type="text/javascript" src="/Public/Admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script src="/Public/Home/js/nprogress.js"></script>
<script src="/Public/Home/js/jquery.lazyload.min.js"></script>
<!--[if gte IE 9]>
  <script src="/Public/Home/js/jquery-1.11.1.min.js" type="text/javascript"></script>
  <script src="/Public/Home/js/html5shiv.min.js" type="text/javascript"></script>
  <script src="/Public/Home/js/respond.min.js" type="text/javascript"></script>
  <script src="/Public/Home/js/selectivizr-min.js" type="text/javascript"></script>
<![endif]-->
</head>
<body class="user-select">
<header class="header">
<nav class="navbar navbar-default" id="navbar">
<div class="container">
  <div class="header-topbar hidden-xs link-border">
	<ul class="site-nav topmenu">
	  <li><a ></a></li>
	  <?php if(empty($user)): ?><li><a onclick="login('<?php echo U('Login/index');?>')" id="login" rel="nofollow" >登录</a></li>
		<li><a onclick="login('<?php echo U('Login/register');?>')" title="注册" >注册</a></li>
		<?php else: ?>
		<li><a href="<?php echo U('User/index');?>" target="_block" rel="nofollow" ><?php echo ($user['username']); ?></a></li>
		<li><a href="<?php echo U('Login/logout');?>" title="退出登录" >退出登录</a></li><?php endif; ?>
	</ul>
			 勤记录 懂分享</div>
  <div class="navbar-header">
	<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#header-navbar" aria-expanded="false"> <span class="sr-only"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button>
	<h1 class="logo hvr-bounce-in"><a href="#" title="木庄网络博客"><img src="/Public/Home/images/201610171329086541.png" alt="木庄网络博客"></a></h1>
  </div>
  <div class="collapse navbar-collapse" id="header-navbar">
	<form class="navbar-form visible-xs" action="/Search" method="post">
	  <div class="input-group">
		<input type="text" name="keyword" class="form-control" placeholder="请输入关键字" maxlength="20" autocomplete="off">
		<span class="input-group-btn">
		<button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
		</span> </div>
	</form>
	<ul class="nav navbar-nav navbar-right">
	  <li><a data-cont="木庄网络博客" title="木庄网络博客" href="<?php echo U('Index/index');?>">首页</a></li>
	  <?php if(is_array($cats)): foreach($cats as $key=>$v): ?><li><a data-cont="<?php echo ($v['cat_name']); ?>" title="<?php echo ($v['cat_name']); ?>" href="<?php echo U('Blog/index',array('cat_id'=>$v['cat_id']));?>" ><?php echo ($v['cat_name']); ?></a></li><?php endforeach; endif; ?>
	</ul>
  </div>
</div>
</nav>
</header>


<section class="container">
<div class="content-wrap">
<div class="content">
  <div class="title">
	<h3 style="line-height: 1.3"><?php echo ($cat_name); ?></h3>
  </div>
  <?php if(is_array($blogs)): $i = 0; $__LIST__ = $blogs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><article class="excerpt excerpt-1"><a class="focus" href="javascript:" onclick="blog_details(<?php echo ($v['id']); ?>,'<?php echo U('BlogDetails/index',array('blog_id'=>$v['id']));?>',<?php echo ($v['money']); ?>)" title="<?php echo ($v['title']); ?>" target="_blank" ><img class="thumb" data-original="<?php echo ($v['theme']); ?>" src="<?php echo ($v['theme']); ?>" alt="<?php echo ($v['title']); ?>"  style="display: inline;"></a>
	<header><a class="cat" href="javascript:" onclick="blog_details(<?php echo ($v['id']); ?>,'<?php echo U('BlogDetails/index',array('blog_id'=>$v['id']));?>',<?php echo ($v['money']); ?>)" title="<?php echo ($cat_name); ?> ><?php echo ($cat_name); ?><i></i></a>
	  <h2><a href="javascript:" onclick="blog_details(<?php echo ($v['id']); ?>,'<?php echo U('BlogDetails/index',array('blog_id'=>$v['id']));?>',<?php echo ($v['money']); ?>)" title="<?php echo ($v['title']); ?>" target="_blank" ><?php echo ($v['title']); ?></a></h2>
	</header>
	<p class="meta">
	  <time class="time"><i class="glyphicon glyphicon-time"></i> <?php echo (date('Y-m-d',$v['time'])); ?></time>
	  <span class="views"><i class="glyphicon glyphicon-eye-open"></i> 217</span> 
	  <a class="comment" href="##comment" title="评论" target="_blank" ><i class="glyphicon glyphicon-comment"></i> <?php echo ($v['contact_count']); ?></a>
	  <span class="views">价格：<?php if($v['money'] == 0): ?>免费<?php else: echo ($v['money']); endif; ?></span>
	  </p>
	<p class="note"><?php echo ($v['description']); ?></p>
  </article><?php endforeach; endif; else: echo "" ;endif; ?>
  
  <nav class="pagination" style="display: none;">
	<?php echo ($show); ?>
  </nav>
</div>
</div>
<aside class="sidebar">
<div class="fixed">
  <div class="widget widget_search">
	<form class="navbar-form" action="<?php echo U('Search/index');?>" method="get">
	  <div class="input-group">
		<input type="text" name="keyword" class="form-control" size="35" placeholder="请输入关键字" maxlength="15" autocomplete="off">
		<span class="input-group-btn">
		<button class="btn btn-default btn-search" name="search" type="submit">搜索</button>
		</span> </div>
	</form>
  </div>
  <div class="widget widget_sentence">
	<h3>标签云</h3>
	<div class="widget-sentence-content">
		<ul class="plinks ptags">   
		<?php if(is_array($keys)): $i = 0; $__LIST__ = $keys;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><li><a href="#list/67/" style='font-size:<?php echo ($v['font']); ?>px;' title="<?php echo ($v['key_name']); ?>" draggable="false"><?php echo ($v['key_name']); ?> <span class="badge"><?php echo ($v['count']); ?></span></a></li><?php endforeach; endif; else: echo "" ;endif; ?>    
		</ul>
	</div>
  </div>
</div>
<?php echo W('New/hotBlog');?>
 <div class="widget widget_sentence">    
	<a href="#" target="_blank" rel="nofollow" title="专业网站建设" >
	<img style="width: 100%" src="/Public/Home/images//201610241224221511.jpg" alt="专业网站建设" ></a>    
 </div>

</div>
</aside>
</section>
<footer class="footer">
<div class="container">
<p><?php echo ($copyright); ?></p>
</div>
<div id="gotop"><a class="gotop"></a></div>
</footer>
<script>
	function blog_details(id,url,money){
		if(money == 0){
			location.href = url;return;
		}
		$.post('<?php echo U("checkDetails");?>',{blog_id:id},function(data){
			if(data.state == -1){
				$('#login').click();
			}else if(data.state == 1){
				location.href = url;return;
			}else{
				layer.confirm('是否购买该文章，价格为：'+money, {
					btn:['购买','取消'] //按钮
					}, function(){
						$.post('<?php echo U("buyBlog");?>',{blog_id:id,money:money},function(res){
							if(res.state == 0){
								layer.msg(res.msg,{icon:5,time:1000});
							}else{
								layer.msg('购买成功',{icon:6,time:1000});
							}
						});
					});
			}
		});
	}
</script>


<script src="/Public/Home/js/bootstrap.min.js"></script>
<script src="/Public/Home/js/jquery.ias.js"></script>
<script src="/Public/Home/js/scripts.js"></script>
<script type="text/javascript" src="/Public/Admin/lib/layer/2.4/layer.js"></script>
<script type="text/javascript">
	function login(url){
		layer.open({
			  type: 2,
			  area: ['700px', '450px'],
			  title: false,
			  closeBtn: 0,
			  shadeClose: true,
			  skin: 'yourclass',
			  content: url,
			});
		
	}
</script>

</body>
</html>